{extend name="default/base/base_home" /}

{block name="mall_main"}
{notpresent name='editable_page'}
<link rel="stylesheet" href="{$Think.HOME_SITE_ROOT}/css/index.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.SuperSlide.2.1.1.js"></script>
<style>
    .mall_nav{border-bottom:none;}
    .mall_nav .all_categorys .mc{display: block;}
</style>
<div class="clear"></div>
<!-- HomeFocusLayout Begin-->
<div class="home-focus-layout">
    {if $adv_index_1}
    <div class="bd">
        <ul>
            {foreach name='adv_index_1' item="v"}
            <li style="background: url({$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_ADV}/{$v.adv_code}) center top no-repeat rgb(35, 35, 35); display: none;background-color: {$v.adv_bgcolor|default=''}" style="{$v.adv_style|default=''}">
                <a href="{:url('Advclick/Advclick',['adv_id'=>$v['adv_id']])}" target="_blank" title="{$v.adv_title}">&nbsp;</a>
            </li>
            {/foreach}
        </ul>
    </div>
    <div class="hd">
        <ul>
            {foreach name='adv_index_1' item="v"}
            <li class=""></li>
            {/foreach}
        </ul>
    </div>
    {/if}

    <div class="right-sidebar">
        <div class="mod_personal_center">
            {if session('is_login')}
            <div class="avata_pic_wrap">
                <a id="index_account_icon_login" href="{:url('Member/index')}" target="_blank"><img class="lazyload"  data-original="{:get_member_avatar(session('avatar'))}?{$Think.TIMESTAMP}"></a>
            </div>
            <div class="info_wrap">
                <div class="login_box">
                    <div class="user_info clearfix">
                        <em>Hi，{:session('member_nickname')}</em>
                    </div>
             
                    <div class="clearfix treasure">
                        <a href="{:url('Memberorder/index',['state_type'=>'state_new'])}" target="_blank" class="gold_coin">
                            <em>{$member_order_info.order_nopay_count}</em>
                            <p>{$Think.lang.pending_payment}</p>
                        </a>
                        <a href="{:url('Memberorder/index',['state_type'=>'state_send'])}" target="_blank" class="gold_coin">
                            <em>{$member_order_info.order_noreceipt_count}</em>
                            <p>{$Think.lang.pending_receipt}</p>
                        </a>
                        <a href="{:url('Memberorder/index',['state_type'=>'state_noeval'])}" target="_blank">
                            <em>{$member_order_info.order_noeval_count}</em>
                            <p>{$Think.lang.pending_comment}</p>
                        </a>
                    </div>
                </div>
            </div>
            {else /}
            <div class="avata_pic_wrap">
                <a id="index_account_icon_unlogin" href="javascript:void(0)"><img class="lazyload"  data-original="{:get_member_avatar(session('avatar'))}?{$Think.TIMESTAMP}"></a>
            </div>
            <div class="info_wrap">
                <div class="unlogin_box">
                    <div class="title">Hi~{$Think.lang.hello}!</div>
                    <div class="tips">
                    </div>
                    <div class="btn_wrap">
                        <a href="{:url('Login/login')}" class="login_btn">{$Think.lang.login}</a>
                        <a href="{:url('Login/register')}" class="regist_btn">{$Think.lang.login_index_regist_now_2}</a>
                    </div>
                </div>
            </div>
            {/if}
            <div class="top_line">
                <div class="vip_list">
                    <a href="javascript:void(0)">
                        <i class="iconfont" style="background:#ff9b1b">&#xe673;</i>
                        <p class="vip_item_text">{$Think.lang.buyer_protection}</p>
                    </a>
                    <a href="javascript:void(0)">
                        <i class="iconfont" style="background:#52a6ff">&#xe67e;</i>
                        <p class="vip_item_text">{$Think.lang.merchant_authentication}</p>
                    </a>
                    <a href="javascript:void(0)">
                        <i class="iconfont" style="background:#57c15b">&#xe74f;</i>
                        <p class="vip_item_text">{$Think.lang.secure_transaction}</p>
                    </a>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="notice_list">
                {foreach $index_articles as $i_a}
                <a title="{$i_a.article_title}" href="{if $i_a.article_url !=''}{$i_a.article_url}{else /}{:url('Article/show',['article_id'=>$i_a.article_id])}{/if}" target="_blank">
                    <span>{$i_a.article_title}</span>
                </a>
                {/foreach}
            </div>
        </div>
    </div>
</div>
<!--HomeFocusLayout End-->
{if $adv_index_2}
<div class="home-scroll w1200 mt10">
    <div class="bd">
        <ul>
            <li>
                {foreach name='adv_index_2' item="v"}
                <a href="{:url('Advclick/Advclick',['adv_id'=>$v['adv_id']])}" target="_blank" title="">
                    <img class="lazyload" data-original="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_ADV}/{$v.adv_code}" style="{$v.adv_style|default=''}">
                </a>
                {/foreach}
            </li>
        </ul>
        <a class="ctrl prev" href="javascript:void(0)"><</a>
        <a class="ctrl next" href="javascript:void(0)">></a>
    </div>
</div>
{/if}



<div class="home-sale-layout w1200 mt20">
    <div class="hd">
        <ul class="tabs-nav">
            <li class="tabs-selected on"><i class="arrow"></i><h3>{$Think.lang.recommendation}</h3></li>
            <li class=""><i class="arrow"></i><h3>{$Think.lang.discount}</h3></li>
            <li class=""><i class="arrow"></i><h3>{$Think.lang.latest_hot_sale}</h3></li>
            <li class=""><i class="arrow"></i><h3>{$Think.lang.shopping_frenzy}</h3></li>
        </ul>
    </div>
    <div class="bd tabs-panel">
        <ul style="display: block;">
            {notempty name="recommend_list"}
            {foreach name="recommend_list" item="goods"}
            <li>
                <dl>
                    
                    <dd class="goods-thumb">
                        <a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}">
                            <img class="lazyload" data-original="{:goods_cthumb($goods.goods_image)}" alt="{$goods.goods_name}">
                        </a>
                    </dd>
                    <dt class="goods-name"><a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}" title="{$goods.goods_name}">{$goods.goods_name}</a></dt>
                    <dd class="goods-price"><em>￥{$goods.goods_price}</em></dd>
                </dl>
            </li>
            {/foreach}
            {/notempty}
        </ul>
        <ul style="display: none;">
            {notempty name="promotion_list"}
            {foreach name="promotion_list" item="goods"}
            <li>
                <dl>
                    
                    <dd class="goods-thumb">
                        <a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}">
                            <img class="lazyload" data-original="{:goods_cthumb($goods.goods_image)}" alt="{$goods.goods_name}">
                        </a>
                    </dd>
                    <dt class="goods-name"><a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}" title="{$goods.goods_name}">{$goods.goods_name}</a></dt>
                    <dd class="goods-price">{$Think.lang.shopping_mall_price}：<em>￥{$goods.xianshigoods_price}</em></dd>
                </dl>
            </li>
            {/foreach}
            {/notempty}
        </ul>
        <ul style="display: none;">
            {notempty name="new_list"}
            {foreach name="new_list" item="goods"}
            <li>
                <dl>
                    
                    <dd class="goods-thumb">
                        <a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}">
                            <img class="lazyload" data-original="{:goods_cthumb($goods.goods_image)}" alt="{$goods.goods_name}">
                        </a>
                    </dd>
                    <dt class="goods-name"><a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}" title="{$goods.goods_name}">{$goods.goods_name}</a></dt>
                    <dd class="goods-price">{$Think.lang.shopping_mall_price}：<em>￥{$goods.goods_price}</em></dd>
                </dl>
            </li>
            {/foreach}
            {/notempty}
        </ul>
        <ul style="display: none;">
            {notempty name="groupbuy_list"}
            {foreach name="groupbuy_list" item="goods"}
            <li>
                <dl>
                    
                    <dd class="goods-thumb">
                        <a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}">
                            <img class="lazyload" data-original="{:groupbuy_thumb($goods.groupbuy_image)}" alt="{$goods.goods_name}">
                        </a>
                    </dd>
                    <dt class="goods-name"><a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}" title="{$goods.goods_name}">{$goods.goods_name}</a></dt>
                    <dd class="goods-price">{$Think.lang.shopping_mall_price}：<em>￥{$goods.groupbuy_price}</em></dd>
                </dl>
            </li>
            {/foreach}
            {/notempty}
        </ul>
    </div>
</div>
<div class="floor_wrap">
    <div class="floor floor0 w1200" style="height:0"></div>
{foreach name="floor_block" item="vo" key="k" }
<div class="{if $k>4}style2{/if} floor floor{php}echo $k+1;{/php} w1200">
    <div class="floor-left">
        <div class="title">
            <h2 title="{$vo.gc_name}">{$vo.gc_name}</h2>
        </div>
        {if $k<5}
        <div class="left-ads">
            {if $k<5 && $vo.adv_left}
            <a href="{:url('Advclick/Advclick',['adv_id'=>$vo['adv_left']['adv_id']])}" target="_blank" title="">
                <img class="lazyload" data-original="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_ADV}/{$vo.adv_left.adv_code}" style="{$vo.adv_left.adv_style|default=''}">
            </a>
            {/if}
        </div>
        {/if}
    </div>
    <div class="floor-right">
        <ul class="tabs-nav hd">
            {foreach name="vo.goods_list" item="list"  key="list_key"}
            <li {if condition="$list_key eq '0'"}class="on"{/if}><h3>{$list.gc_name}</h3></li>
            {/foreach}
        </ul>
        <div class="goods-list bd">
            {foreach name="vo.goods_list" item="list" key="list_key"}
            <ul class="clearfix"  {if condition="$list_key eq '0'"}style="display:block"{/if}>
                {notempty name="list.gc_list"}
                {foreach name="list.gc_list" key="goods_key" item="goods"}
                {if ($k<5 && $goods_key<8) || $k>4}
                <li>
                    <dl>
                        
                        <dd class="goods-thumb">
                            <a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}">
                                <img class="lazyload" data-original="{:goods_cthumb($goods.goods_image)}" alt="{$goods.goods_name}"/>
                            </a>
                        </dd>
                        <dt class="goods-name"><a target="_blank" href="{:url('Goods/index',['goods_id'=>$goods.goods_id])}" title="{$goods.goods_name}">{$goods.goods_name}</a></dt>
                        <dd class="goods-price">
                            <em>{$goods.goods_price}{$Think.lang.ds_yuan}</em>
                            {if $goods.goods_marketprice > 0}
                            <span class="original">{$goods.goods_marketprice}{$Think.lang.ds_yuan}</span>
                            {/if}
                        </dd>
                    </dl>
                </li>
                {/if}
                {/foreach}
                {/notempty}
            </ul>
            {/foreach}
        </div>
    </div>
</div>

<div class="w1200 floor-banner">
    {if $k<5 && $vo.adv_bottom}
    <a href="{:url('Advclick/Advclick',['adv_id'=>$vo['adv_bottom']['adv_id']])}" target="_blank" title="">
        <img class="lazyload" data-original="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_ADV}/{$vo.adv_bottom.adv_code}" style="{$vo.adv_bottom.adv_style|default=''}">
    </a>
    {/if}
</div>
<script>
    jQuery(".floor{php}echo $k+1;{/php} .floor-right").slide({mainCell: ".bd", autoPlay: false, interTime: 5000});
</script>
{/foreach}
</div>

<div class="wrapper mt10"></div>
<div class="index-link wrapper">
    <dl class="website">
        <dt>{$Think.lang.cooperative_partner} | {$Think.lang.friendship_link}<b></b></dt>
        <dd>
            {notempty name="link_list"}
            {foreach name="link_list" item="val"}
            <a href="{$val.link_url}" target="_blank" title="{$val.link_title}">{:str_cut($val.link_title,15)}</a>
            {/foreach}
            {/notempty}
        </dd>
    </dl>
</div>
<div class="footer-line"></div>
<!--首页底部保障开始-->

<!--首页底部保障结束-->
<!--StandardLayout Begin-->

<!--StandardLayout End-->


<!--首页悬浮弹窗BEGIN-->
{if $Think.config.ds_config.fixed_suspension_state}
<div class="fixed-suspension-layer" style="display: none;">
    <div class="fixed-suspension-con">
        <a href="{$Think.config.ds_config.fixed_suspension_url}" class="fixed-suspension-img">
		<img class="lazy" src="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_COMMON}/{$Think.config.ds_config.fixed_suspension_img}">
        </a>
        <div class="close-fixed-suspension"></div>
	</div>
</div>
<script type="text/javascript">
if(!localStorage.fixed_ad_layer){
        $('.fixed-suspension-layer').show();
}
//悬浮广告弹出层
$('body').on('click','.close-fixed-suspension',function(){
        localStorage.fixed_ad_layer = true;
        $('.fixed-suspension-layer').hide();
});
</script>
{/if}
<!--首页悬浮弹窗END-->



<style>
.fsFixedTopContent{display:none;overflow:visible;width:50px;height:auto;position:fixed;left:50%;top:40%;margin:-150px 0 0 -675px;z-index:3333;}
.fsFixedTop{width:50px;height:auto;background:#fdfdfd;box-shadow: 0 0 4px rgba(0,0,0,.2);-webkit-transform:scale(1.2);-moz-transform:scale(1.2);transform:scale(1.2);opacity:0;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;transition:all .3s ease;position:absolute;left:0;top:0}
.fsFixedTop a{width:36px;height:36px;line-height:36px;display:block;position:relative;cursor:pointer;text-decoration:none;padding:7px;border-top: 1px solid #D4D4D4;}
.fsFixedTop b{width:36px;height:36px;color:#333;font-size:13px;font-weight:600;text-align:center;display:block;}
.fsFixedTop .fs-name{width:36px;height:36px;line-height:18px;color:#ff4040;text-align:center;display:none;overflow:hidden;font-size:13px;letter-spacing: 1px;word-wrap:break-word;}
.fsFixedTop a.active{background:#ff4040 }
.fsFixedTop a.active .fs-name{color:#fff;display:block;}
.fsFixedTop a.active .fs {display: none}
.fsFixedTop a.active .fs-name:hover {background:#ff4040;text-decoration:none}
.fsFixedTop a:hover{background:#ff4040}
.fsFixedTop a:hover .fs-name {display: block;color: #fff}
.fsFixedTop a:hover b {display: none}
</style>
<div class="fsFixedTopContent" style="visibility: hidden; display: block;">
    <div class="fsFixedTop" style="opacity: 0;"> 
        {foreach name="floor_block" item="vo" key="k" }
        <a class="smooth active" href="javascript:;"> <b class="fs">{$k+1}F</b> <em class="fs-name">{$vo.gc_name}</em> </a> 
        {/foreach}
    </div>
    </div>		
<script>
    $(function () {
        $(window).scroll(function () {
            var scrt = $(window).scrollTop();
            if (scrt > 1000) {
                $(".fsFixedTopContent").show("fast", function () {
                    $(".fsFixedTop").css({
                        "-webkit-transform": "scale(1)",
                        "-moz-transform": "scale(1)",
                        "transform": "scale(1)",
                        "opacity": "1"
                    })
                }).css({
                    "visibility": "visible"
                })
            } else {
                $(".fsFixedTop").css({
                    "-webkit-transform": "scale(1.2)",
                    "-moz-transform": "scale(1.2)",
                    "transform": "scale(1.2)",
                    "opacity": "0"
                });
                $(".fsFixedTopContent").css({
                    "visibility": "hidden"
                })
            }
            setTab()
        });
        var arr = [],fsOffset = 0;
        for (var i = 1; i < $(".floor").length; i++) {
            arr.push(parseInt($(".floor").eq(i).offset().top) + 30)
        }
        $(".fsFixedTop a.smooth").on("click", function () {
            var _th = $(this);
            _th.blur();
            var index = $(".fsFixedTop a.smooth").index(this);
            if (index > 0) {
                fsOffset =index* 100-50;
            }else{
                fsOffset =-50;
            }
            var hh = arr[index];
            var clickheight = hh+fsOffset;
            $("html,body").stop().animate({
                scrollTop:clickheight+ "px"
            }, 400)
        });
        $(".fsFixedTop a.fsbacktotop").click(function () {
            $("html,body").stop().animate({
                scrollTop: 0
            }, 400)
        })

        function setTab() {
            var Objs = $(".floor:gt(0)");
            var textSt = $(window).scrollTop();
            for (var i = Objs.length - 1; i >= 0; i--) {
                if (textSt >= $(Objs[i]).offset().top - 50) {
                    $(".fsFixedTop a").eq(i).addClass("active").siblings().removeClass("active");
                    return;
                }
            }
        }
    });
</script>



<script>
    //轮播
    jQuery(".home-focus-layout").slide({mainCell: ".bd ul", autoPlay: true, delayTime: 500, interTime: 5000});
    jQuery(".home-scroll").slide({mainCell: ".bd li", autoPage: true,autoPlay: true, delayTime: 1000, effect: "left", interTime: 5000, vis: 5});
    jQuery(".home-sale-layout").slide({autoPlay: false, });
</script>

{else}
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.SuperSlide.2.1.1.js"></script>
<script>
    var EDITABLE_PAGE_URL='{$Think.ADMIN_SITE_URL}/editable_page'
</script>
{include file="default/base/editable_page_model/common"}
{/notpresent}
{/block}